Toggling visibility of elements is best done in jQuery like this. It is important to recursively show to avoid children staying invisible.

<pre>
&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js">&lt;/script>
&lt;script>
  google.load('jquery', '1.3.1');

  function toggleVisibility(id) {
    if($(id).is(":visible")) {
       $(id).hide();
    } else {
       $(id)
       .show()
       .children().show();
    }
  }
&lt;/script>
</pre>
